﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Linq;
using WaitLess.Business.Data.Foursquare;
using WaitLess.Business.Data.Foursquare.Interfaces;
using WaitLess.Business.Data.Model.Foursquare.HereNowResponse;
using WaitLess.Business.Data.Model.Foursquare.VenuesResponse;
using WaitLess.Business.Data.Web;
using WaitLess.Business.Data.Web.Interfaces;
using WaitLess.Business.Repositories;
using WaitLess.Business.Repositories.Interfaces;
using WaitLess.Business.Tests.Common;

namespace WaitLess.Business.Tests.Integration.Repositories.CheckinRepositorySpecifications
{
    [TestClass]
    public class WhenCheckin : AsyncTestBase
    {
        protected ICheckinRepository CheckinRepository { get; private set; }
        protected IWebRequestor WebRequestor { get; private set; }
        protected IFoursquareContext FoursquareContext { get; private set; }

        public Data.Model.Foursquare.CheckinRequest.Request Request { get; set; }

        protected override void Arrange()
        {
            base.Arrange();
            WebRequestor = new WebRequestor();
            FoursquareContext = new FoursquareContext(WebRequestor);
            CheckinRepository = new CheckinRepository(FoursquareContext);

            Request = new Data.Model.Foursquare.CheckinRequest.Request();
            Request.VenueId = "4caec3a61168a093be0a1d23";   // Districtshuis Merksem
            Request.AccessToken = "VXBBQRYJANHU4PEP1AOJVRBR4DEDPX3TG41XXEJ1NBHAAZ1I";
            Request.Latitude = "51.2161";
            Request.Longitude = "004.4150";
        }

        protected override void Act()
        {
            CheckinRepository.Create(Request, () =>
            {
                IsActCompleted = true;
            });
        }

        [TestMethod]
        public void ThenNoExceptionShouldOccur()
        {
            Assert.IsTrue(true);
        }
    }
}
